var config_gl = {
	apiPath: "http://47.106.65.176/api/",
	// apiPath: "http://127.0.0.1:8086/api/"
}

function getKaptch() {
	$.ajax(config_gl.apiPath + "kaptcha", {
		type: 'get', //HTTP请求类型
		timeout: 10000, //超时时间设置为10秒；
		success: function(data) {
			var base64 = data.data.kaptchaBase64;
			var img = document.createElement("img");
			img.src = base64;
			document.body.appendChild(img);
		},
		error: function(xhr, type, errorThrown) {

		}
	});
}

function login(code) {
	$.ajax(config_gl.apiPath + "login", {
		type: 'post', //HTTP请求类型
		contentType: "application/json",
		data: JSON.stringify({
			code: code,
			password: "123456",
			userName: "huazai"
		}),
		success: function(data) {},
		error: function(xhr, type, errorThrown) {

		}
	});
}
